﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.Common;
using System.Data.SqlClient;

public class CtrlBDState
{
    String strConnect;
    String strSql;
    SqlConnection connection;
    SqlDataAdapter adapter;
    DataSet dataSet;

    public CtrlBDState()
    {
        strConnect = ConfigurationManager.ConnectionStrings["conexion"].ConnectionString;
        connection = new SqlConnection(strConnect);
    }

    public DataSet getData()
    {
        dataSet = new DataSet();

        connection.Open();
        strSql = "SELECT * FROM State";
        adapter = new SqlDataAdapter(strSql, connection);
        adapter.Fill(dataSet, "State");
        connection.Close();
        return dataSet;
    }
}
